<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<%@ page isELIgnored="false"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta>
<title><c:out value="${pageTitle }">OoM-管理首页</c:out></title>
	<meta name="keywords" content="个人博客,wjyuian技术站" />
	<meta name="description" content="wjyuian技术站" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<link href="/static/css/base.css" rel="stylesheet" />
	<link href="/static/css/index.css" rel="stylesheet" />
	<link href="/static/css/m.css" rel="stylesheet" />
	<link rel="icon" href="/static/img/logo.ico" type="image/x-icon" />
        <script src="/static/plugin/jquery.min.js"></script>

<!--[if lt IE 9]>
<script src="js/modernizr.js"></script>
<![endif]-->


<style type="text/css">
.topnav ul {
	margin: 0px;
}

span.keywordHighLight{
	color : red;
}

.navbor li ul li {
	margin-left : 0px !important;
}
</style>

	<script type="text/javascript">
	function jumpPage(n) {
		var form = $('#searchform');
		form.find('input[name="pageNo"]').val(n);
		form.submit();
	}
	
	function rebuildIndex() {
		var form = $('#rebuildForm');
		if(!confirm('确定重建索引？')) {
			return ;
		}
		form.submit();
	}
	</script>
</head>

<body>
	<header>
		<div class="tophead">
			<div class="logo">
				<a href="/home"><img src="/static/img/logo_nav.png" width="225" height="50" /></a>
			</div>
			<nav class="topnav" id="topnav">
				<ul>
					<li><a href="/article/index" id="topnav_current">管理文章</a></li>
					<li><a href="/article/album">管理专辑</a></li>
					<li><a href="/article/publish">发布文章</a></li>
				</ul>
			</nav>
		</div>
	</header>
    <div class="header-blank">
    </div>
	
<article>
	<div class="blogs" style="margin : auto;">
        <div class="blogs-1">
	    <c:choose>
			<c:when test="${ not empty articles.list }">  
				<c:forEach var="article" items="${ requestScope.articles.list }" varStatus="status" >
			    <li> 
			    
                    <h3 class="blogtitle"><a href="/articledetail?atclid=${article.id}" target="_blank">${article.title }</a></h3>
                    
                    <c:if test="${not empty article.thumbnailImgUrl }">
                    <span class="blogpic">
                        <a href="/articledetail?atclid=${article.id}" target="_blank">
                            <img src="<c:out value="${article.thumbnailImgUrl }">https://oomabc.com/staticsrc/img/201809/25/1537852410029_eda9dd1328e64bb8afa0b97a3c2c6c91.jpg</c:out>_260X150">
                        </a>
                    </span>
                    </c:if>
                    
			      	<div class="bloginfo">
                        <a href="/articledetail?atclid=${article.id}" target="_blank">
                            <p>${article.content }</p>
                        </a>
			      	</div>
			      	<div class="autor">
			      		<c:if test="${not empty article.tags }">
			      		<span class="lm">
			      			<c:forEach var="tag" items="${article.tags }" varStatus="status">
			      			<a href="/list?tag=${tag }" target="_blank" class="classname">${tag }</a>&nbsp;&nbsp;
			      			</c:forEach>
			      		</span>
			      		</c:if>
			      		<span class="viewnum">浏览（<a href="#">${article.viewCount }</a>）</span>
			      		<span class="readmore"><a target="_blank" href="publish?atclid=${article.id}">编辑文章>></a></span>
			      	</div>
			    </li>
				</c:forEach>     
				
		   	</c:when>
		   	<c:otherwise> 
				<div>no </div>
		   	</c:otherwise>
		</c:choose>
	   </div>
	
            <!-- 分页 -->
            <c:if test="${not empty articles.pages }">
            <div class="pagelist">
        
                <c:forEach var="pageModel" items="${ articles.pages }" varStatus="status" >
                    <c:choose>
                        <c:when test="${ pageModel.link }">  
                            <a href="index?pageNo=${ pageModel.pageNo }">${ pageModel.pageDesc }</a>&nbsp;
                        </c:when>
                        <c:otherwise>
                            <b>${ pageModel.pageDesc }</b>&nbsp;
                        </c:otherwise>
                    </c:choose>
                </c:forEach>
            </div>
            </c:if>
	
  </div>
  
  <div class="sidebar" style="margin-top : 0px;">
    	<div class="search" style="">
	      	<form action="index" method="get" name="searchform" id="searchform">
	        	<input name="keyword" id="keyboard" class="input_text" placeholder="请输入关键字" value="${query.keyword }" style="color: rgb(153, 153, 153); outline: none; height : 24px;" onfocus="if(value=='请输入关键字'){this.style.color='#000';value=''}" onblur="if(value==''){this.style.color='#999';value='请输入关键字'}" type="text">
	        	<input name="pageNo" value="${query.pageNo }" type="hidden">
        		<input name="tag" value="${query.tag }" type="hidden">
	        	<input name="pageSize" value="${query.pageSize }" type="hidden">
        		<input class="input_submit" value="搜索" type="submit" />
	      	</form>
	    </div>
 
	    <div class="lmnav">
			<h2 class="hometitle">栏目导航</h2>
			<ul class="navbor">
				<li><span>不止技术</span>
					<ul>
						<li><a href="index?categoryId=1">工程化应用（<c:out value="${categoryFacet.category1.count }">0</c:out>）</a></li>
						<li><a href="index?categoryId=2">技术学习/探索（<c:out value="${categoryFacet.category2.count }">0</c:out>）</a></li>
						<li><a href="index?categoryId=4">自娱自乐（<c:out value="${categoryFacet.category4.count }">0</c:out>）</a></li>
					</ul></li>
				<li><span>还有生活</span>
					<ul>
						<li><a href="index?categoryId=3">随便写写（<c:out value="${categoryFacet.category3.count }">0</c:out>）</a></li>
					</ul></li>
				<li><a href="index?categoryId=5">娱乐/放松（<c:out value="${categoryFacet.category5.count }">0</c:out>）</a></li>
			</ul>
		</div>
		<!-- 点击排行 -->    
		<c:if test="${not empty hotArticle}">
	    <div class="paihang">
	      	<h2 class="hometitle">点击排行</h2>
	      	<ul>
				<c:forEach var="article" items="${ hotArticle }" varStatus="status" >
		        <li>
		        	<b><a href="articledetail?atclid=${article.id}" target="_blank">${article.title}</a></b>
		          	<%-- <p><i><img src="/static/img/mb02.jpg"></i>博客从最初的域名购买，到上线已经有四年的时间了，这四年的时间，有笑过，有怨过，有悔过，有执着过，也...</p> --%>
		        </li>
				</c:forEach>
	      	</ul>
	    </div>
		</c:if>
		
	   
	 	<!-- 标签 -->
	   	<c:if test="${not empty hotTags}">
	    <div class="cloud">
	      	<h2 class="hometitle">标签云</h2>
	      	<ul>
				<c:forEach var="tag" items="${ hotTags }" varStatus="status" >
					<a href="#">${tag }</a>
				</c:forEach>
			</ul>
	    	</div>
		</c:if>
		
		<!-- 站长推荐 -->    
		<c:if test="${not empty priorityArticle}">
	    <div class="paihang">
	      	<h2 class="hometitle">站长推荐</h2>
	      	<ul>
				<c:forEach var="article" items="${ priorityArticle }" varStatus="status" >
		        <li>
		        	<b><a href="articledetail?atclid=${article.id}" target="_blank">${article.title}</a></b>
		        </li>
				</c:forEach>
	      	</ul>
	    </div>
		</c:if>

	    
	    <div style="padding-left : 15px;">
	       <form id="rebuildForm" action="./rebuild" target="/manager/index" method="post">
	           <a href="javascript:void(0);" onclick="rebuildIndex();">重建索引</a>
	       </form>
	    </div>
  	</div>
  	
</article>



</body>
</html>